package com.orange.lockscreen.server;

import android.appwidget.AppWidgetHostView;
import android.content.Context;
import android.view.View;
import android.widget.FrameLayout;

import com.orange.lockscreen.common.Constants.LSWidget_Type;
import com.orange.lockscreen.common.LogHelper;

public class LSWidgetHostView extends AppWidgetHostView implements
		LSWidget_Type {

	private static final String	TAG		= "LSWidgetHostView";

	private int					mType	= TYPE_INVALID;

	public LSWidgetHostView(Context context, int type) {
		super(context);
		mType = type;
		LogHelper.v(TAG,
				"LSWidgetHostView create [type=0x" + Integer.toHexString(mType)
						+ "]");
	}

	public int getWidgetType() {
		return mType;
	}

	@Override
	protected void prepareView(View view) {
		FrameLayout.LayoutParams requested = (FrameLayout.LayoutParams) view
				.getLayoutParams();
		if (requested == null) {
			requested = new FrameLayout.LayoutParams(LayoutParams.FILL_PARENT,
					LayoutParams.FILL_PARENT);
		}
		view.setLayoutParams(requested);
	}
}
